/*
 * WebAlbumRetriever.java
 *
 * Created on May 15, 2007, 12:40:13 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package webalbum;

import com.google.gdata.client.photos.PicasawebService;
import com.google.gdata.data.Link;
import com.google.gdata.data.media.MediaSource;
import com.google.gdata.data.media.mediarss.MediaContent;
import com.google.gdata.data.media.mediarss.MediaGroup;
import com.google.gdata.data.photos.AlbumEntry;
import com.google.gdata.data.photos.AlbumFeed;
import com.google.gdata.data.photos.GphotoEntry;
import com.google.gdata.data.photos.PhotoEntry;
import com.google.gdata.data.photos.PhotoFeed;
import com.google.gdata.data.photos.UserFeed;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
import webalbum.google.GoogleWebAlbumRetriever;

/**
 *
 * @author zheismann
 */
public final class WebAlbumFactory
{
    private WebAlbumFactory(){}
    public static final String PICASA = "picasaWebAlbum";
    
    public static List<WebAlbum> getWebAlbums(String albumType, URI uri) throws Exception
    {
        List<WebAlbum> albums = new ArrayList<WebAlbum>();
        if (PICASA.equals(albumType))
        {
            albums = GoogleWebAlbumRetriever.getInstance().getWebAlbums(uri);
        }
        else
        {
            new Exception("Unhandled AlbumType: " + albumType).printStackTrace();
        }
        return albums;
    }
    public static void main(String arg[]) throws Exception
    {
        URI uri = new URI("http://picasaweb.google.com/data/feed/api/user/zac.heismann");
        List<WebAlbum> albums = WebAlbumFactory.getWebAlbums(PICASA, uri);
        for (WebAlbum album : albums)
        {
            System.out.println(album);
        }
    }
}
